<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/11
 * Time: 10:34
 */
    $path = "./pic";
    $fileType = array("image/jpeg","image/png","image/gif");
    $maxSize = 0;
    $data = array();
    require "functions.php";
    $name = $_FILES['upic']['name'];
    $type = $_FILES['upic']['type'];
    $tmp_name = $_FILES['upic']['tmp_name'];
    $size = $_FILES['upic']['size'];
    $error = $_FILES['upic']['error'];
    for($i=0;$i<count($name);$i++){
        $data['name'] = $name[$i];
        $data['type'] = $type[$i];
        $data['tmp_name'] = $tmp_name[$i];
        $data['error'] = $error[$i];
        $data['size'] = $size[$i];
        upload($path,$fileType,$maxSize,$data);
        echo "<script>window.location.href='./index.php';</script>";
    }
